package com.buddy.jni.demo11;

/**
 * JNI引用
 *  全局引用
 *  本地引用
 */
public class JNIReference {
    static {
        System.loadLibrary("jni_reference");
    }

    // A native method that returns a java.lang.Integer with the given int.
    private native Integer getIntegerObject(int number);

    // Another native method that also returns a java.lang.Integer with the given int.
    private native Integer anotherGetIntegerObject(int number);

    public static void main(String args[]) {
        JNIReference jniReference = new JNIReference();
        System.out.println(jniReference.getIntegerObject(1));
        System.out.println(jniReference.getIntegerObject(2));
        System.out.println(jniReference.anotherGetIntegerObject(11));
        System.out.println(jniReference.anotherGetIntegerObject(12));
        System.out.println(jniReference.getIntegerObject(3));
        System.out.println(jniReference.anotherGetIntegerObject(13));
    }

}
